package com.example.question.tree.tree3;

import com.example.question.tree.tree1.TreeNode;

public class Code01_226 {
    public static void main(String[] args) {

    }


    public TreeNode invertTree(TreeNode root) {
        process(root);
        return root;
    }

    private void process(TreeNode node) {
        if (node == null) {
            return;
        }
        process(node.left);
        process(node.right);

        TreeNode tmp = node.left;
        node.left = node.right;
        node.right = tmp;
    }


}
